#!/usr/bin/env python3
# -*- mode: python; coding: utf-8; -*-
##--------------------------------------------------------------------------##
##
## Copyright (C) 1998-2003 Markus Oberhumer <markus@oberhumer.com>
## Copyright (C) 2003 Mt. Hood Playing Card Co.
## Copyright (C) 2005-2010 Skomoroh <skomoroh@users.sourceforge.net>
## Copyright (C) 2010-2013 Jeremy Austin-Bardo <tjaustinbardo@gmail.com>
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses/>.
##
##--------------------------------------------------------------------------##
__all__ = []

def dir_(direction):
    if direction > 0:
        return 1
    elif direction < 0:
        return -1
    return 0

PAIR_SUM_THIRTEEN = _('Pairs with sum of 13 will drop')
PAIR_SUM_FOURTEEN = _('Pairs with sum of 14 will drop')
PAIR_SUM_ELEVEN = _('Pairs with sum of 11 will drop')
PAIR_SUM_ELEVEN_SUIT = _('Pairs by same suit with sum of 11 will drop')
PAIR_SUM_FIFTEEN = _('Pairs with sum of 15 will drop')
PAIR_EITHER_SAME = _('Pairs built up or down in rank alone or by same rank'
                     ' will drop')
PAIR_JACK = _('Pairs with 2 Jacks will drop')
PAIR_QUEEN_KING = _('Pairs of Queen and King will drop')
PILE_SEQUENCE_RANK = ('Top cards in group build in rank alone will drop.')
CARDS_LESS_TEN = _('Accepts a rank lower than 10')
PAIR_KINGS_ALONE = _('Any King will drop alone')
SEQUENCE_T_J_Q_K = ('Seqeunce of 10, Jack, Queen, King will drop')
ONE_J_Q_K = _('Accepts Jack, Queen, or King, but no two piles with same rank')
ONE_J_Q_K_SUIT = _('Accepts Jack, Queen, or King by same, but no two piles'
                   ' with same rank')
NO_BUILD_STR = _('No building.')
KINGS_ONLY = _('Only Kings are accepted.')
BUILD_REGARDLESS = _('Build in any order by any next card.')
BUILD_REGARDLESS_SS = _('Build in any order by same suit.')
MATCH_FOUNDATIONS = _('Must match order of other foundations.')
FIRST_RANK_STR = _('First card sets base rank for group.')
FREECELL_STR = _('Any sequence may move if enough FreeCells are available.')
SPIDER_AC_STR = _('Any sequence may move if in rank by alternate color.')
SPIDER_SS_STR = _('Any sequence may move if in rank by same suit.')
SPIDER_SC_STR = _('Any sequence may move if in rank by same color.')
SPIDER_SS_SR_STR = _('Any sequence may move if in rank by same suit or same'
                     ' rank.')
YUKON_STR = _('Any face-up cards may move regardless of seqeunce.')
EITHER_SC_STR = _('Build up or down by same color.')
EITHER_AC_STR = _('Build up or down by alternate color.')
EITHER_SS_STR = _('Build up or down by same suit.')
EITHER_RK_STR = _('Build up or down in rank alone.')
SUPERMOVE_STR = _('Any sequence may move if enough FreeCells and rows are'
                  'available.')
BUILD_SS_DICT = {-1: _('Build up in rank by same suit.'),
                  0: _('Build by same rank.'),
                  1: _('Build down in rank by same suit.')}
BUILD_RK_DICT = {-1: _('Build up in rank alone.'),
                  0: _('Build by same rank.'),
                  1: _('Build down in rank alone.')}
BUILD_AC_DICT = {-1: _('Build up in rank by alternate color.'),
                  0: _('Build by same rank.'),
                  1: _('Build down in rank by alternate color.')}
BUILD_SC_DICT = {-1: _('Build up in rank by same color.'),
                  0: _('Build by same rank.'),
                  1: _('Build down in rank by same color.')}
BUILD_BO_DICT = {-1: _('Build up in rank by alternate suit.'),
                  0: _('Build by same rank.'),
                  1: _('Build down in rank by alternate suit.')}
BUILD_AF_DICT = {-1: _('Build up in rank by alternate force.'),
                  0: _('Build by same rank.'),
                  1: _('Build down in rank by alternate force.')}
BUILD_SF_DICT = {-1: _('Build up in rank by same force.'),
                  0: _('Build by same rank.'),
                  1: _('Build down in rank by same force.')}
BUILD_SS_SR_DICT = {-1: _('Build up in rank by same suit or same rank.'),
                     0: _('Build by same rank.'),
                     1: _('Build down in rank by same suit or same rank.')}
BUILD_AC_SR_DICT = {-1: _('Build up in rank by alternate color or same'
                          ' rank.'),
                     0: _('Build by same rank.'),
                     1: _('Build down in rank by alternate color or same'
                          ' rank.')}
BUILD_RK_SR_DICT = {-1: _('Build up in rank alone or same rank.'),
                     0: _('Build by same rank.'),
                     1: _('Build down in rank alone or same rank.')}
DROP_SS_DICT = {-1: _('Accepts full sequence built up in rank by same suit.'),
                 0: _('Accepts full sequence by same rank.'),
                 1: _('Accepts full sequence built down in rank by same'
                      ' suit.')
                }
DROP_AC_DICT = {-1: _('Accepts full sequence built up in rank by alternate'
                      'color.'),
                 0: _('Accepts full sequence by same rank.'),
                 1: _('Accepts full sequence built down in rank by alternate'
                      'color.')}
DROP_RK_DICT = {-1: _('Accepts full sequence built up in rank alone.'),
                 0: _('Accepts full sequence by same rank.'),
                 1: _('Accepts full sequence built down in rank alone.')
                }
BUILD_SUIT_DICT = {-1: _('Build up in suit by same rank.'),
                    0: _('Build by same rank.'),
                    1: _('Build down in rank by same rank.')}
SWAPS_DICT = {0: _('All but Willow may swap third and fourth rank cards.'),
              1: _('Each suit may swap third and fourth rank cards.')}
BUILD_SRK_DICT = {-1: _('Pair same ranks, then build up in rank alone.'),
                   0: _('Build by same rank.'),
                   1: _('Pair same ranks, then build down in rank alone.')}

BUILD_DIR = lambda d: (_('Ascending') if d > 0
                       else _('Descending') if d < 0 else '')

FOUND_RK_TEXT = _('1st: A 2 3 4 5 6 7 8 9 T J Q K\n'
                  '2nd: 2 4 6 8 T Q A 3 5 7 9 J K\n'
                  '3rd: 3 6 9 Q 2 5 8 J A 4 7 T K\n'
                  '4th: 4 8 Q 3 7 J 2 6 T A 5 9 K')

FOUND_SS_TEXT = _('Club: A 2 3 4 5 6 7 8 9 T J Q K\n'
                  'Heart: 2 4 6 8 T Q A 3 5 7 9 J K\n'
                  'Spade: 3 6 9 Q 2 5 8 J A 4 7 T K\n'
                  'Diamond: 4 8 Q 3 7 J 2 6 T A 5 9 K')